package ctn.hibernate.po;

// Generated 2011-12-8 2:29:36 by Hibernate Tools 3.2.4.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * CtnUser generated by hbm2java
 */
@Entity
@Table(name = "ctn_user", catalog = "cpa", uniqueConstraints = {
		@UniqueConstraint(columnNames = "EMAIL"),
		@UniqueConstraint(columnNames = "NAME") })
public class CtnUser implements java.io.Serializable {

	private Long id;
	private String name;
	private String password;
	private String email;
	private String status;
	private Long levelCount;
	private Long faildCount;
	private Date createDate;
	private Date updateDate;
	private Set<CtnUserMsg> ctnUserMsgs = new HashSet<CtnUserMsg>(0);
	private Set<CtnCpaOut> ctnCpaOuts = new HashSet<CtnCpaOut>(0);
	private Set<CtnUserFileCfg> ctnUserFileCfgs = new HashSet<CtnUserFileCfg>(0);
	private Set<CtnCpaSpec> ctnCpaSpecs = new HashSet<CtnCpaSpec>(0);
	private Set<CtnGrp> ctnGrps = new HashSet<CtnGrp>(0);

	public CtnUser() {
	}

	public CtnUser(Long id, String name, String password, String email,
			Long levelCount) {
		this.id = id;
		this.name = name;
		this.password = password;
		this.email = email;
		this.levelCount = levelCount;
	}

	public CtnUser(Long id, String name, String password, String email,
			String status, Long levelCount, Long faildCount, Date createDate,
			Date updateDate, Set<CtnUserMsg> ctnUserMsgs,
			Set<CtnCpaOut> ctnCpaOuts, Set<CtnUserFileCfg> ctnUserFileCfgs,
			Set<CtnCpaSpec> ctnCpaSpecs, Set<CtnGrp> ctnGrps) {
		this.id = id;
		this.name = name;
		this.password = password;
		this.email = email;
		this.status = status;
		this.levelCount = levelCount;
		this.faildCount = faildCount;
		this.createDate = createDate;
		this.updateDate = updateDate;
		this.ctnUserMsgs = ctnUserMsgs;
		this.ctnCpaOuts = ctnCpaOuts;
		this.ctnUserFileCfgs = ctnUserFileCfgs;
		this.ctnCpaSpecs = ctnCpaSpecs;
		this.ctnGrps = ctnGrps;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "NAME", unique = true, nullable = false, length = 16)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "PASSWORD", nullable = false, length = 16)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "EMAIL", unique = true, nullable = false, length = 100)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "STATUS", length = 1)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "LEVEL_COUNT", nullable = false)
	public Long getLevelCount() {
		return this.levelCount;
	}

	public void setLevelCount(Long levelCount) {
		this.levelCount = levelCount;
	}

	@Column(name = "FAILD_COUNT")
	public Long getFaildCount() {
		return this.faildCount;
	}

	public void setFaildCount(Long faildCount) {
		this.faildCount = faildCount;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_DATE", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UPDATE_DATE", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "ctnUser")
	public Set<CtnUserMsg> getCtnUserMsgs() {
		return this.ctnUserMsgs;
	}

	public void setCtnUserMsgs(Set<CtnUserMsg> ctnUserMsgs) {
		this.ctnUserMsgs = ctnUserMsgs;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "ctnUser")
	public Set<CtnCpaOut> getCtnCpaOuts() {
		return this.ctnCpaOuts;
	}

	public void setCtnCpaOuts(Set<CtnCpaOut> ctnCpaOuts) {
		this.ctnCpaOuts = ctnCpaOuts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "ctnUser")
	public Set<CtnUserFileCfg> getCtnUserFileCfgs() {
		return this.ctnUserFileCfgs;
	}

	public void setCtnUserFileCfgs(Set<CtnUserFileCfg> ctnUserFileCfgs) {
		this.ctnUserFileCfgs = ctnUserFileCfgs;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "ctnUser")
	public Set<CtnCpaSpec> getCtnCpaSpecs() {
		return this.ctnCpaSpecs;
	}

	public void setCtnCpaSpecs(Set<CtnCpaSpec> ctnCpaSpecs) {
		this.ctnCpaSpecs = ctnCpaSpecs;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "ctn_user_grp", catalog = "cpa", joinColumns = { @JoinColumn(name = "USER_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "GRP_ID", nullable = false, updatable = false) })
	public Set<CtnGrp> getCtnGrps() {
		return this.ctnGrps;
	}

	public void setCtnGrps(Set<CtnGrp> ctnGrps) {
		this.ctnGrps = ctnGrps;
	}

}
